﻿<%@ Page Title="米米彩票_参与合买" Language="C#" MasterPageFile="~/App_Master/MasterPage_Red.master" AutoEventWireup="true" CodeFile="togetherbuy.aspx.cs" Inherits="togetherbuy" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="App_Themes/css/stylekaijiang.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function addBuytogether(LotteryYE, id) {
            var userbuy = $("#buyMoeny" + id).val();
            var reg = new RegExp("^[0-9]*$");
            if (!reg.test(userbuy)) {
                document.getElementById("buyMoeny" + id).value = 0;
                alert("请您填写购买金额!");
                return;
            } 
            if (userbuy == "" || userbuy<=0) {
                alert("请您填写购买金额!");
            } else if (LotteryYE < userbuy) {
                alert("您购买金额大于剩余金额!");
            }
            else if(userbuy<1)
            {
                alert("购买金额不能小于1元!");
            }
            else {
                jQuery('form').attr("action", "/Ajax/CMember.ashx?t=joinTogether&id=" + id + "&tomoney=" + userbuy).submit();
            }
        }
    </script>
    <script src="App_Themes/js/jquery.jBox-2.3.min.js" type="text/javascript"></script>
    <script src="App_Themes/js/jquery.jBox-zh-CN.js" type="text/javascript"></script>
    <link href="App_Themes/css/Red/jbox.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function lotteryInfo(id) {
            $.jBox("iframe:/buyInfo.aspx?id=" + id, {
                title: "查看合买号码详细",
                width: 600,
                height: 400,
                top: 100,
                buttons: {}
            })
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="main">
        <div class="buy_title">
            <!--<asp:DropDownList ID="qsddl" runat="server" AutoPostBack="true" OnSelectedIndexChanged="qsddl_SelectedIndexChanged" Height="20px" Width="118px">
            </asp:DropDownList>-->
            <asp:DropDownList ID="isManDDl" runat="server" AutoPostBack="true"
                Height="21px" Width="97px"
                OnSelectedIndexChanged="isManDDl_SelectedIndexChanged">
                <asp:ListItem Value="0">--全部--</asp:ListItem>
                <asp:ListItem Value="1">--未满员--</asp:ListItem>
                <asp:ListItem Value="2">--50%-90%--</asp:ListItem>
                <asp:ListItem Value="3">--90%以上--</asp:ListItem>
            </asp:DropDownList>
            <asp:DropDownList ID="jineDDl" runat="server" AutoPostBack="true"
                Height="20px" Width="118px"
                OnSelectedIndexChanged="jineDDl_SelectedIndexChanged">
                <asp:ListItem Value="0">--不限金额--</asp:ListItem>
                <asp:ListItem Value="1">--100元以下--</asp:ListItem>
                <asp:ListItem Value="2">--100-500元--</asp:ListItem>
                <asp:ListItem Value="3">--500-1000元--</asp:ListItem>
                <asp:ListItem Value="4">--1000元以上--</asp:ListItem>
            </asp:DropDownList>
            <div class="hemai">
                <p>发起合买</p>
                <div class="hemai_ul_box">
                    <dl class="hemai_dl">
                        <dt><a href="">数字</a></dt>
                        <dd><a href="double_betting.aspx" target="view_blank">双色球</a></dd>
                         <dd><a href="dlt_betting.aspx" target="view_blank">大乐透</a></dd>
                         <dd><a href="3d_1d.aspx" target="view_blank">福彩3D</a></dd>
                    </dl>
                    <hr class="line_hmai" />
                    <dl class="hemai_dl">
                        <dt><a href="">竞技</a></dt>
                        <dd><a href="double_betting.aspx" target="view_blank">双色球</a></dd>
                         <dd><a href="dlt_betting.aspx" target="view_blank">大乐透</a></dd>
                         <dd><a href="3d_1d.aspx" target="view_blank">福彩3D</a></dd>
              
                    </dl>
                </div>
            </div>
        </div>
        <!--buy_title  end-->
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table2">
            <tr class="table2_tr">
                <td>序</td>
                <td>发起人</td>
                <td>彩种</td>
                <td>期次</td>
                <td>方案标题</td>
                <td>进度+保底</td>
                <td>方案金额</td>
                <td>剩余金额</td>
                <td>我要购买</td>
                <td>详情</td>
                <td>操作</td>
            </tr>
            <%if (userbuy != null)
                {
                    for (int i = 0; i < userbuy.Count; i++)
                    {%>
            <tr>
                <td><%=i+1%></td>
                <td><%=SelectName(userbuy[i].UserID) %></td>
                <td><%=userbuy[i].LotteryType == 1 ? "双色球"
                            : (userbuy[i].LotteryType == 2 ? "大乐透"
                                      : (userbuy[i].LotteryType == 3 ? "排列三"
                                                : (userbuy[i].LotteryType == 4 ? "排列五"
                                                          : (userbuy[i].LotteryType == 5 ? "福彩3D"
                                                                    : (userbuy[i].LotteryType == 6 ? "七星彩"
                                                                              : (userbuy[i].LotteryType == 7 ? "七乐彩" : ""))))))%></td>

                <td><%=userbuy[i].LotteryOpenTime%></td>
                <td><%=userbuy[i].Name%></td>
                <td><%=userbuy[i].LotteryJD%>%+<%=userbuy[i].MyGua%><%--%<img src="App_Themes/images/he_img.jpg" alt="" >--%></td>
                <td><span class="hei1"><%=userbuy[i].LotteryMoney%></span>元</td>
                <td><span class="hong2"><%=userbuy[i].LotteryYE%></span>元</td>
                <td>
                    <input type="text" class="input1" id="buyMoeny<%=userbuy[i].id%>" /></td>
                <td><a href="javascript:void(0);" onclick="return lotteryInfo(<%=userbuy[i].id %>)" class="lan">详情</a></td>
                <% 
                    if (userbuy[i].State)
                    { %>
                <td>定制人数达到上限
                       
                </td>
                <%}
                    else
                    {%>

                <td>
                    <input type="button" value="购买" onclick="javascript:addBuytogether(<%=userbuy[i].LotteryYE%>,<%=userbuy[i].id%>)" /></td>
                <% }%>
            </tr>
            <%}
                }%>
        </table>
        <div class="sabrosus">
            <webdiyer:AspNetPager SubmitButtonClass="buttons" ID="AspNetPager1"
                runat="server" AlwaysShow="True" FirstPageText="首页"
                NextPageText="下一页" PrevPageText="前一页" LastPageText="尾页" PageSize="10"
                OnPageChanged="AspNetPager1_PageChanged">
            </webdiyer:AspNetPager>
        </div>
        <div class="clear"></div>
    </div>
    <!--main  end-->
</asp:Content>

